// component/orderAll/orderAll.js
var config = require("../../utils/config.js");
var network = require("../../utils/network.js");
Component({
  /**
   * 组件的属性列表
   */
  properties: {
    openid:String
  },

  /**
   * 组件的初始数据
   */
  data: {
    all:[]
  },

  /**
   * 组件的方法列表
   */
  methods: {
    getOrderData: function () {
      network.request({
        url: config.host + 'api_word/order',
        method: "POST",
        data: { openid: this.data.openid, status: 'all' },
        success: res => {
          console.log("订单")
          console.log(res.data.data)
          if (res.data.code == 99) {
            this.setData({
              all:res.data.data
            })
          } else {
            wx.showToast({
              title: res.data.msg,
              icon: "none"
            })
          }
        }
      })
    },
    gotoOrderForm: function (e) {
      let id = e.currentTarget.dataset.id
      wx.navigateTo({
        url: '/pages/orderform/orderform?id=' + id,
      })
    }
  }
})
